#{extends 'logged_user.html' /}
#{set title:'Handshake Detail' /}

<div id="main" style="padding-top:0px">
  <div class="post" style="padding:top:0px">
    #{if created}
    <h3>An application for the handshake has been initiated</h3>
    #{/if}
    #{if cancelled}
    <h3>The application for the handshake has been cancelled</h3>
    #{/if}
    #{if accepted}
    <h3>You have accepted the application.</h3>
    #{/if}
    #{if startedByBoth}
    <h3>Both parties have acknowledged that the handshake has been started. Honey combs have been divided among the bees.</h3>
    #{/if}
    #{elseif startedByOne}
    <h3>You have acknowledged the start of the handshake. The other party must also acknowledge in order to commence dividing of honey combs.</h3>
    #{/elseif}
    #{if handshakeItem}
    <h4>Handshake Details</h4>
    <table>
      <tr>
	<th>Title</th>
	<th>Offerer</th>
	<th>Requester</th>
	<th>Description</th>
	<th>Tags</th>
	<th>Created On</th>
      </tr>
      <tr>
	<td>
	  #{if handshakeItem.isOriginallyAnOffer}
	  ${handshakeItem.offer.title}
	  #{/if}
	  #{else}
	  ${handshakeItem.request.title}
	  #{/else}
	</td>
	<td>
	  ${handshakeItem.offer.user.fullname}
	</td>
	<td>	  
	  ${handshakeItem.request.user.fullname}
	</td>
	<td>
	  ${handshakeItem.offer.description}
	</td>
	<td>
	  #{if handshakeItem.offer.tags}
	  ${handshakeItem.offer.tags.join(', ')}
	  #{/if}
	  #{else}
	  ${handshakeItem.request.tags.join(', ')}
	  #{/else}
	</td>
	<td>
	  ${handshakeItem.creationDate.format('dd MMMM yyyy')}
	</td>
      </tr>
    </table>
    #{/if}
  </div>
</div>
